package dcutils.rpg.characters;

// Import DCUtils Classes
import dcutils.rpg.env.d2.Coords;

/**
 * Non-instantiable.<br/>
 * Contains all elements common to all characters.
 * @author dca
 */
public abstract class Character {
   protected String name;
   protected Coords location;

   protected Character(String name) {
      name(name);
      location = new Coords(0, 0);
   } // END constructor

   protected Character(String name, Coords location) {
      name(name);
      location(location);
   } // END constructor

   public String name() {
      return this.name;
   } // END name getter

   protected void name(String name) {
      this.name = name;
   } // END name setter

   public Coords location() {
      return this.location;
   } // END location getter

   protected void location(Coords location) {
      this.location = location;
   } // END location setter

   @Override
   public String toString() {
      final StringBuffer buffer = new StringBuffer();

      buffer.append(name());
      buffer.append(String.format("%n%s = %s", "location", location()));

      return buffer.toString();
   } // END toString
} // END class Character
